#
# Top level makefile for building "pits" on OpenWRT
#

include $(TOPDIR)/rules.mk

PKG_NAME:=pits
PKG_VERSION:=1.0.0
PKG_RELEASE:=1

export LDFLAGS:=-s

include $(INCLUDE_DIR)/package.mk

define Package/pits
	SECTION:=net
	CATEGORY:=Network
	TITLE:=pits -- Cloudprint Proxy
endef

define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	$(CP) -a src/* $(PKG_BUILD_DIR)
endef

define Build/Configure
endef

TARGET_CFLAGS += $(FPIC)

define Package/pits/install
	$(INSTALL_DIR) $(1)/bin
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_BIN) pitsd.init $(1)/etc/init.d/pitsd
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/pitsd $(1)/bin/
endef

$(eval $(call BuildPackage,pits))
